<?php
require_once "Common/database.php";
require_once "Common/values.php";

   $result = mysql_query("SELECT * FROM tblUsers WHERE Name='$user'");
   $row = mysql_fetch_array($result);
if($row[s]>1)
{
switch($_GET[f2])
{
case('status');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>key</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td>Line</td><td><input type=text name="line" value=""></td></tr>';
echo '<tr><td>Project</td><td><input type=text name="project" value="all"></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('applications');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>ID</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('Projects');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>key</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td>Users</td><td><input type=text name="users" value=""></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;



case('folders');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>key</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('kbfolders');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>key</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td>Users</td><td><input type=text name="users" value="all"></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('Proirty');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>key</td><td><input type=text name=key Disabled></td</tr>';
echo '<tr><td>Name</td><td><input type=text name="name" value=""></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('Select');
echo '<p><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<form action="system/helpdesk/uinsert.php?f2='.$_GET[f2].'" method="POST">
<tr><td><align=right>Select Name: <input type=text name="select" value="">'.'</td>
<tr><td><p align=right>Users: <input type=text name="user" value="all"></td></tr>
<tr><td><p align=right>Log Number: <input type=text name="lognumber" value="%"></td></tr>
<tr><td><p align=right>Due: <input type=text name="due" value="%"></td></tr>
<tr><td><p align=right>Assigned: <input type=text name="assigned" value="%"></td></tr>
<tr><td><p align=right>Requestor: <input type=text name="requestor" value="%"></td></tr>
<tr><td><p align=right>Subject: <input type=text name="subject" value="%"></td></tr>
<tr><td><p align=right>Proirty: <input type=text name="proirty" value="%"></td></tr>
<tr><td><p align=right>Status: <input type=text name="status" value="%"></td></tr>
<tr><td><p align=right>Project: <input type=text name="project" value="helpdesk"></td></tr>
<tr><td><p align=right>Open/Closed: <input type=text name="closed" value="Open"></td></tr>
<tr><td><p align=right>Line: <input type=text name="line" value="%"></td></tr>
<tr><td><p align=right>Branch<input type=text name="branch" value="%"></td></tr>
<tr><td><p align=right>Department<input type=text name="department" value="%"></td></tr>
<tr><td><p align=right>Private<input type=text name="private" value="%"></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('dSelect');
echo '<p><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<form action="system/helpdesk/uinsert.php?f2='.$_GET[f2].'" method="POST">
<tr><td><align=right>Select Name: <input type=text name="select" value="">'.'</td>
<tr><td><p align=right>Users: <input type=text name="user" value="all"></td></tr>
<tr><td><p align=right>Log Number: <input type=text name="lognumber" value="%"></td></tr>
<tr><td><p align=right>Due: <input type=text name="due" value="%"></td></tr>
<tr><td><p align=right>Assigned: <input type=text name="assigned" value="%"></td></tr>
<tr><td><p align=right>Requestor: <input type=text name="requestor" value="%"></td></tr>
<tr><td><p align=right>Subject: <input type=text name="subject" value="%"></td></tr>
<tr><td><p align=right>Proirty: <input type=text name="proirty" value="%"></td></tr>
<tr><td><p align=right>Status: <input type=text name="status" value="%"></td></tr>
<tr><td><p align=right>Project: <input type=text name="project" value="helpdesk"></td></tr>
<tr><td><p align=right>Open/Closed: <input type=text name="closed" value="Open"></td></tr>
<tr><td><p align=right>Line: <input type=text name="line" value="%"></td></tr>
<tr><td><p align=right>Branch<input type=text name="branch" value="%"></td></tr>
<tr><td><p align=right>Department<input type=text name="department" value="%"></td></tr>
<tr><td><p align=right>Private<input type=text name="private" value="%"></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('branches');
echo '<p><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>ID</td><td><input type=text name="id"></td</tr>';
echo '<tr><td>Branch Number</td><td><input type=text name="number" value=""></td></tr>';
echo '<tr><td>Branch Name</td><td><input type=text name="name" value=""></td></tr>';

echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;

case('ldap');
echo '<P><h3>Add '.$_GET[f2].'</h3>';
echo '<FORM action="system/helpdesk/insert.php?f2='.$_GET[f2].'" method="POST">';
echo '<table border=1>';
echo '<tr><td>ID</td><td><input type=text name=id Disabled></td</tr>';
echo '<tr><td>dn</td><td><input type=text name="dn" value=""></td></tr>';
echo '<tr><td><INPUT type="submit" value="Add"></td></tr>';
echo '</FORM></table>';
break;
}
}
else
{
    echo'<p><h3>Access Deined</h3>';
}
?>